fix: Bulk email recipient options - #171
Conversation
|
Thanks for the pull request, @Inferato! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
9cb6fa8 to
02d17ae
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #171 +/- ##
==========================================
+ Coverage 83.01% 83.18% +0.17%
==========================================
Files 46 47 +1
Lines 683 690 +7
Branches 132 135 +3
==========================================
+ Hits 567 574 +7
Misses 116 116 ☔ View full report in Codecov by Sentry. |
| courseModes | ||
| && courseModes.length > 1 | ||
| && courseModes.map((courseMode) => ( |
There was a problem hiding this comment.
I propose to move logical operations into a separate variable, this will simplify the readability of the code.
| courseModes | |
| && courseModes.length > 1 | |
| && courseModes.map((courseMode) => ( | |
| const isCourseModes = courseModes && courseModes.length > 1; | |
| ... | |
| isCourseModes && courseModes.map((courseMode) => ( |
There was a problem hiding this comment.
Good point! I already moved it. Thx!
| @@ -0,0 +1,18 @@ | |||
| import { Factory } from 'rosie'; // eslint-disable-line import/no-extraneous-dependencies | |||
|
|
|||
| const courseModeFactory = () => { | |||
There was a problem hiding this comment.
It would be a good idea to add some jsDocs documentation for this code. What do you think?
There was a problem hiding this comment.
OK. It has already been added. Check please and add any suggestions if needed.
| <BulkEmailProvider> | ||
| <BulkEmailForm courseId="test" cohorts={cohorts} /> | ||
| <BulkEmailForm | ||
| courseId="test" |
There was a problem hiding this comment.
Just a suggestion: let's come up with a more meaningful name for this identifier 💯
There was a problem hiding this comment.
Do you have any examples? I used the same name as in the backend.
There was a problem hiding this comment.
mockCourseId or exampleCourseId
Please, If it's possible
There was a problem hiding this comment.
Ok, if it is necessary. This ID was here before I made the changes to the tests so I didn't check this part for correctness
There was a problem hiding this comment.
I decided to not change courseId value to save the common style of test values.
| * | ||
| * @returns {Object[]} An array of course mode objects generated by different factories. | ||
| */ | ||
| import { Factory } from 'rosie'; // eslint-disable-line import/no-extraneous-dependencies |
There was a problem hiding this comment.
It seems to me that there is no need to write jsDocs for import.
There was a problem hiding this comment.
This is a doc for the module, not for import
There was a problem hiding this comment.
I would remove it, but I leave the decision up to you 👍
| additionalCohorts, | ||
| courseModes, | ||
| } = props; | ||
| const isCourseModes = courseModes && courseModes.length > 1; |
There was a problem hiding this comment.
| const isCourseModes = courseModes && courseModes.length > 1; | |
| const hasCourseModes = courseModes && courseModes.length > 1; |
| </Form.Checkbox> | ||
| { | ||
| // additional modes | ||
| isCourseModes |
There was a problem hiding this comment.
| isCourseModes | |
| hasCourseModes |
|
Sorry for the delays, Taras is no longer a member of RG. I will leave the status update comments on each PR's comments ASAP |
|
Hello @arbrandes Could you close this PR? I can't add edits to the source branch so I opened a new one where I took the source branch from here as it is and just applied your suggestions. |
|
closing per the comment above. |
|
@Inferato Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
According to the chapter Sending Email Messages to Learners in Different Enrollment Tracks course can may more than one mode and instructor must have the ability to send the email for users in this modes.

Communication MFE had a hardcoded 2 modes for every course. Sometimes it lead to the error.
courseModeswas added tocourseMetadatato display real course email recipient options.Related MR: